package com.xbongbong.saas.enums;

import com.xbongbong.pro.enums.permission.enums.ProPermissionAliasEnum;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;

/**
 * 各业务详情头部按钮
 *
 * @author haibin.zhang
 * @version v1.0
 * @date 2019/1/23 22:25
 * @since v1.0
 */
@Getter
public enum BusinessDetailButtonEnum {
    // 业务详情头部
    // 客户
    CUSTOMER_COPY(RedundantTemplateTypeEnum.CUSTOMER.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.CUSTOMER.getCode(), ProPermissionAliasEnum.CUSTOMER_ADD.getAlias()),
    CUSTOMER_EDIT(RedundantTemplateTypeEnum.CUSTOMER.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.CUSTOMER.getCode(), ProPermissionAliasEnum.CUSTOMER_UPDATE.getAlias()),
    CUSTOMER_DEL(RedundantTemplateTypeEnum.CUSTOMER.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.CUSTOMER.getCode(), ProPermissionAliasEnum.CUSTOMER_DELETE.getAlias()),
    CUSTOMER_ARCHIVED(RedundantTemplateTypeEnum.CUSTOMER.getCode(), SaasButtonEnum.ARCHIVED, RedundantTemplateTypeEnum.CUSTOMER.getCode(), ProPermissionAliasEnum.CUSTOMER_ARICHIVE.getAlias()),
    CUSTOMER_CANCEL_ARCHIVED(RedundantTemplateTypeEnum.CUSTOMER.getCode(), SaasButtonEnum.CANCEL_ARCHIVED, RedundantTemplateTypeEnum.CUSTOMER.getCode(), ProPermissionAliasEnum.CUSTOMER_ARICHIVE.getAlias()),

    // 联系人
    CONTACT_COPY(RedundantTemplateTypeEnum.CONTACT.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.CONTACT.getCode(), ProPermissionAliasEnum.CONTACT_ADD.getAlias()),
    CONTACT_EDIT(RedundantTemplateTypeEnum.CONTACT.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.CONTACT.getCode(), ProPermissionAliasEnum.CONTACT_UPDATE.getAlias()),
    CONTACT_DEL(RedundantTemplateTypeEnum.CONTACT.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.CONTACT.getCode(), ProPermissionAliasEnum.CONTACT_DELETE.getAlias()),

    // 销售机会
    OPPORTUNITY_COPY(RedundantTemplateTypeEnum.SALES_OPPORTUNITY.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.SALES_OPPORTUNITY.getCode(), ProPermissionAliasEnum.OPPORTUNITY_ADD.getAlias()),
    OPPORTUNITY_EDIT(RedundantTemplateTypeEnum.SALES_OPPORTUNITY.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.SALES_OPPORTUNITY.getCode(), ProPermissionAliasEnum.OPPORTUNITY_UPDATE.getAlias()),
    OPPORTUNITY_DEL(RedundantTemplateTypeEnum.SALES_OPPORTUNITY.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.SALES_OPPORTUNITY.getCode(), ProPermissionAliasEnum.OPPORTUNITY_DELETE.getAlias()),
    OPPORTUNITY_ARCHIVED(RedundantTemplateTypeEnum.SALES_OPPORTUNITY.getCode(), SaasButtonEnum.ARCHIVED, RedundantTemplateTypeEnum.SALES_OPPORTUNITY.getCode(), ProPermissionAliasEnum.OPPORTUNITY_ARCHIVE.getAlias()),
    OPPORTUNITY_PRINT(RedundantTemplateTypeEnum.SALES_OPPORTUNITY.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.SALES_OPPORTUNITY.getCode(), ProPermissionAliasEnum.OPPORTUNITY_PRINT.getAlias()),
    OPPORTUNITY_CANCEL_ARCHIVED(RedundantTemplateTypeEnum.SALES_OPPORTUNITY.getCode(), SaasButtonEnum.CANCEL_ARCHIVED, RedundantTemplateTypeEnum.SALES_OPPORTUNITY.getCode(), ProPermissionAliasEnum.OPPORTUNITY_ARCHIVE.getAlias()),

    // 合同订单
    CONTRACT_COPY(RedundantTemplateTypeEnum.CONTRACT.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.CONTRACT.getCode(), ProPermissionAliasEnum.CONTRACT_ADD.getAlias()),
    CONTRACT_EDIT(RedundantTemplateTypeEnum.CONTRACT.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.CONTRACT.getCode(), ProPermissionAliasEnum.CONTRACT_UPDATE.getAlias()),
    CONTRACT_ARCHIVED(RedundantTemplateTypeEnum.CONTRACT.getCode(), SaasButtonEnum.ARCHIVED, RedundantTemplateTypeEnum.CONTRACT.getCode(), ProPermissionAliasEnum.CONTRACT_ARCHIVE.getAlias()),
    CONTRACT_CANCEL_ARCHIVED(RedundantTemplateTypeEnum.CONTRACT.getCode(), SaasButtonEnum.CANCEL_ARCHIVED, RedundantTemplateTypeEnum.CONTRACT.getCode(), ProPermissionAliasEnum.CONTRACT_ARCHIVE.getAlias()),
    CONTRACT_DEL(RedundantTemplateTypeEnum.CONTRACT.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.CONTRACT.getCode(), ProPermissionAliasEnum.CONTRACT_DELETE.getAlias()),
    CONTRACT_PRINT(RedundantTemplateTypeEnum.CONTRACT.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.CONTRACT.getCode(), ProPermissionAliasEnum.CONTRACT_PRINT.getAlias()),
    CONTRACT_COMPARE(RedundantTemplateTypeEnum.CONTRACT.getCode(), SaasButtonEnum.CONTRACT_COMPARE, RedundantTemplateTypeEnum.CONTRACT.getCode(), ProPermissionAliasEnum.CONTRACT_COMPARE_RESULT_ADD.getAlias()),

    // 客户跟进记录
    COMMUNICATE_COPY(RedundantTemplateTypeEnum.COMMUNICATE.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.COMMUNICATE.getCode(), ProPermissionAliasEnum.CUSTOMER_COMMUNICATE_ADD.getAlias()),

    // 访客计划
    PLAN_COPY(RedundantTemplateTypeEnum.COMMUNICATE_PLAN.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.COMMUNICATE_PLAN.getCode(), ProPermissionAliasEnum.COMMUNICATE_PLAN_ADD.getAlias()),
    PLAN_COMPLETE(RedundantTemplateTypeEnum.COMMUNICATE_PLAN.getCode(), SaasButtonEnum.COMPLETE, RedundantTemplateTypeEnum.COMMUNICATE.getCode(), ProPermissionAliasEnum.COMMUNICATE_PLAN_UPDATE.getAlias()),
    PLAN_DELAY(RedundantTemplateTypeEnum.COMMUNICATE_PLAN.getCode(), SaasButtonEnum.DELAY, RedundantTemplateTypeEnum.COMMUNICATE_PLAN.getCode(), ProPermissionAliasEnum.COMMUNICATE_PLAN_UPDATE.getAlias()),
    PLAN_DEL(RedundantTemplateTypeEnum.COMMUNICATE_PLAN.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.COMMUNICATE_PLAN.getCode(), ProPermissionAliasEnum.COMMUNICATE_PLAN_DELETE.getAlias()),
    PLAN_QUIT(RedundantTemplateTypeEnum.COMMUNICATE_PLAN.getCode(), SaasButtonEnum.QUIT, RedundantTemplateTypeEnum.COMMUNICATE_PLAN.getCode(), ProPermissionAliasEnum.COMMUNICATE_PLAN_UPDATE.getAlias()),

    // 回款管理 - 应收款
    PAYMENT_RED(RedundantTemplateTypeEnum.PAYMENT.getCode(), SaasButtonEnum.RED_RECEIVABLES, XbbRefTypeEnum.RED_RECEIVABLES.getCode(), ProPermissionAliasEnum.RED_RECEIVABLES.getAlias()),
    PAYMENT_WRITE_OFF(RedundantTemplateTypeEnum.PAYMENT.getCode(), SaasButtonEnum.PAYMENT_WRITE_OFF, RedundantTemplateTypeEnum.PAYMENT.getCode(), ProPermissionAliasEnum.PAYMENT_WRITE_OFF.getAlias()),
    //PAYMENT_BAD(RedundantTemplateTypeEnum.PAYMENT.getCode(), SaasButtonEnum.BAD_DEBT, XbbRefTypeEnum.BAD_DEBT.getCode(), ProPermissionAliasEnum.PAYMENT_SHEET_BAD.getAlias()),
    PAYMENT_EDIT(RedundantTemplateTypeEnum.PAYMENT.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.PAYMENT.getCode(), ProPermissionAliasEnum.PAYMENT_UPDATE.getAlias()),
    PAYMENT_DEL(RedundantTemplateTypeEnum.PAYMENT.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.PAYMENT.getCode(), ProPermissionAliasEnum.PAYMENT_DELETE.getAlias()),
    PAYMENT_REVERT(RedundantTemplateTypeEnum.PAYMENT.getCode(), SaasButtonEnum.RETURN, RedundantTemplateTypeEnum.PAYMENT_SHEET.getCode(), ProPermissionAliasEnum.PAYMENT_SHEET_DELETE.getAlias()),
    PAYMENT_PRINT(RedundantTemplateTypeEnum.PAYMENT.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.PAYMENT.getCode(), ProPermissionAliasEnum.PAYMENT_PRINT.getAlias()),
    
    // 付款管理
    PAY_PLAN_BAD(RedundantTemplateTypeEnum.PAY_PLAN.getCode(), SaasButtonEnum.BAD_DEBT, XbbRefTypeEnum.BAD_PAY.getCode(), ProPermissionAliasEnum.PAY_SHEET_BAD.getAlias()),
    PAY_PLAN_EDIT(RedundantTemplateTypeEnum.PAY_PLAN.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.PAY_PLAN.getCode(), ProPermissionAliasEnum.PAY_PLAN_UPDATE.getAlias()),
    PAY_PLAN_DEL(RedundantTemplateTypeEnum.PAY_PLAN.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.PAY_PLAN.getCode(), ProPermissionAliasEnum.PAY_PLAN_DELETE.getAlias()),
    PAY_PLAN_REVERT(RedundantTemplateTypeEnum.PAY_PLAN.getCode(), SaasButtonEnum.RETURN, RedundantTemplateTypeEnum.PAY_SHEET.getCode(), ProPermissionAliasEnum.PAY_SHEET_DELETE.getAlias()),
    PAY_PLAN_PRINT(RedundantTemplateTypeEnum.PAY_PLAN.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.PAY_PLAN.getCode(), ProPermissionAliasEnum.PAY_PLAN_PRINT.getAlias()),
    
    // 发票
    INVOICE_EDIT(RedundantTemplateTypeEnum.INVOICE.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.INVOICE.getCode(), ProPermissionAliasEnum.INVOICE_UPDATE.getAlias()),
    INVOICE_CANCEL(RedundantTemplateTypeEnum.INVOICE.getCode(), SaasButtonEnum.CANCEL, RedundantTemplateTypeEnum.INVOICE.getCode(), ProPermissionAliasEnum.INVOICE_CANCEL.getAlias()),
    INVOICE_RED(RedundantTemplateTypeEnum.INVOICE.getCode(), SaasButtonEnum.RED, RedundantTemplateTypeEnum.INVOICE.getCode(), ProPermissionAliasEnum.INVOICE_RED.getAlias()),
    INVOICE_DEL(RedundantTemplateTypeEnum.INVOICE.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.INVOICE.getCode(), ProPermissionAliasEnum.INVOICE_DELETE.getAlias()),
    INVOICE_RETURN(RedundantTemplateTypeEnum.INVOICE.getCode(), SaasButtonEnum.REVERT_CANCEL, RedundantTemplateTypeEnum.INVOICE.getCode(), ProPermissionAliasEnum.INVOICE_CANCEL.getAlias()),
    INVOICE_PRINT(RedundantTemplateTypeEnum.INVOICE.getCode(),SaasButtonEnum.PRINT,RedundantTemplateTypeEnum.INVOICE.getCode(),ProPermissionAliasEnum.INVOICE_PRINT.getAlias()),
    INVOICE_LINK_CONTRACT(RedundantTemplateTypeEnum.INVOICE.getCode(),SaasButtonEnum.LINK_CONTRACT,RedundantTemplateTypeEnum.INVOICE.getCode(),ProPermissionAliasEnum.INVOICE_LINK_CONTRACT.getAlias()),

    //进项发票
    PURCHASE_INVOICE_EDIT(RedundantTemplateTypeEnum.PURCHASE_INVOICE.getCode(),SaasButtonEnum.EDIT,RedundantTemplateTypeEnum.PURCHASE_INVOICE.getCode(),ProPermissionAliasEnum.PURCHASE_INVOICE_UPDATE.getAlias()),
    PURCHASE_INVOICE_CANCEL(RedundantTemplateTypeEnum.PURCHASE_INVOICE.getCode(),SaasButtonEnum.CANCEL,RedundantTemplateTypeEnum.PURCHASE_INVOICE.getCode(),ProPermissionAliasEnum.PURCHASE_INVOICE_CANCEL.getAlias()),
    PURCHASE_INVOICE_RED(RedundantTemplateTypeEnum.PURCHASE_INVOICE.getCode(),SaasButtonEnum.RED,RedundantTemplateTypeEnum.PURCHASE_INVOICE.getCode(),ProPermissionAliasEnum.PURCHASE_INVOICE_RED.getAlias()),
    PURCHASE_INVOICE_DEL(RedundantTemplateTypeEnum.PURCHASE_INVOICE.getCode(),SaasButtonEnum.DEL,RedundantTemplateTypeEnum.PURCHASE_INVOICE.getCode(),ProPermissionAliasEnum.PURCHASE_INVOICE_DELETE.getAlias()),
    PURCHASE_INVOICE_RETURN(RedundantTemplateTypeEnum.PURCHASE_INVOICE.getCode(),SaasButtonEnum.REVERT_CANCEL,RedundantTemplateTypeEnum.PURCHASE_INVOICE.getCode(),ProPermissionAliasEnum.PURCHASE_INVOICE_CANCEL.getAlias()),
    PURCHASE_INVOICE_PRINT(RedundantTemplateTypeEnum.PURCHASE_INVOICE.getCode(),SaasButtonEnum.PRINT,RedundantTemplateTypeEnum.PURCHASE_INVOICE.getCode(),ProPermissionAliasEnum.PURCHASE_INVOICE_PRINT.getAlias()),

    // 产品
    PRODUCT_COPY(RedundantTemplateTypeEnum.PRODUCT.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.PRODUCT.getCode(), ProPermissionAliasEnum.PRODUCT_ADD.getAlias()),
    PRODUCT_EDIT(RedundantTemplateTypeEnum.PRODUCT.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.PRODUCT.getCode(), ProPermissionAliasEnum.PRODUCT_UPDATE.getAlias()),
    PRODUCT_DEL(RedundantTemplateTypeEnum.PRODUCT.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.PRODUCT.getCode(), ProPermissionAliasEnum.PRODUCT_DELETE.getAlias()),
    // 入库单
    PURCHASE_INSTOCK_EDIT(RedundantTemplateTypeEnum.PURCHASE_INSTOCK.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.PURCHASE_INSTOCK.getCode(), ProPermissionAliasEnum.PURCHASE_INSTOCK_UPDATE.getAlias()),
    PURCHASE_INSTOCK_DEL(RedundantTemplateTypeEnum.PURCHASE_INSTOCK.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.PURCHASE_INSTOCK.getCode(), ProPermissionAliasEnum.PURCHASE_INSTOCK_DELETE.getAlias()),
    PURCHASE_INSTOCK_PRINT(RedundantTemplateTypeEnum.PURCHASE_INSTOCK.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.PURCHASE_INSTOCK.getCode(), ProPermissionAliasEnum.PURCHASE_INSTOCK_PRINT.getAlias()),
    REFUND_INSTOCK_EDIT(RedundantTemplateTypeEnum.REFUND_INSTOCK.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.REFUND_INSTOCK.getCode(), ProPermissionAliasEnum.REFUND_INSTOCK_UPDATE.getAlias()),
    REFUND_INSTOCK_DEL(RedundantTemplateTypeEnum.REFUND_INSTOCK.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.REFUND_INSTOCK.getCode(), ProPermissionAliasEnum.REFUND_INSTOCK_DELETE.getAlias()),
    REFUND_INSTOCK_PRINT(RedundantTemplateTypeEnum.REFUND_INSTOCK.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.REFUND_INSTOCK.getCode(), ProPermissionAliasEnum.REFUND_INSTOCK_PRINT.getAlias()),
    OTHER_INSTOCK_EDIT(RedundantTemplateTypeEnum.OTHER_INSTOCK.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.OTHER_INSTOCK.getCode(), ProPermissionAliasEnum.INSTOCK_UPDATE.getAlias()),
    OTHER_INSTOCK_DEL(RedundantTemplateTypeEnum.OTHER_INSTOCK.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.OTHER_INSTOCK.getCode(), ProPermissionAliasEnum.INSTOCK_DELETE.getAlias()),
    OTHER_INSTOCK_PRINT(RedundantTemplateTypeEnum.OTHER_INSTOCK.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.OTHER_INSTOCK.getCode(), ProPermissionAliasEnum.INSTOCK_PRINT.getAlias()),
    PRODUCTION_INSTOCK_EDIT(RedundantTemplateTypeEnum.PRODUCTION_INSTOCK.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.PRODUCTION_INSTOCK.getCode(), ProPermissionAliasEnum.PRODUCTION_INSTOCK_UPDATE.getAlias()),
    PRODUCTION_INSTOCK_DEL(RedundantTemplateTypeEnum.PRODUCTION_INSTOCK.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.PRODUCTION_INSTOCK.getCode(), ProPermissionAliasEnum.PRODUCTION_INSTOCK_DELETE.getAlias()),
    PRODUCTION_INSTOCK_PRINT(RedundantTemplateTypeEnum.PRODUCTION_INSTOCK.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.PRODUCTION_INSTOCK.getCode(), ProPermissionAliasEnum.PRODUCTION_INSTOCK_PRINT.getAlias()),
    RETURNED_MATERIEL_INSTOCK_EDIT(RedundantTemplateTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(), ProPermissionAliasEnum.RETURNED_MATERIEL_INSTOCK_UPDATE.getAlias()),
    RETURNED_MATERIEL_INSTOCK_DEL(RedundantTemplateTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(), ProPermissionAliasEnum.RETURNED_MATERIEL_INSTOCK_DELETE.getAlias()),
    RETURNED_MATERIEL_INSTOCK_PRINT(RedundantTemplateTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(), ProPermissionAliasEnum.RETURNED_MATERIEL_INSTOCK_PRINT.getAlias()),

    // 出库单
    CONTRACT_OUTSTOCK_EDIT(RedundantTemplateTypeEnum.CONTRACT_OUTSTOCK.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.CONTRACT_OUTSTOCK.getCode(), ProPermissionAliasEnum.CONTRACT_OUTSTOCK_UPDATE.getAlias()),
    CONTRACT_OUTSTOCK_DEL(RedundantTemplateTypeEnum.CONTRACT_OUTSTOCK.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.CONTRACT_OUTSTOCK.getCode(), ProPermissionAliasEnum.CONTRACT_OUTSTOCK_DELETE.getAlias()),
    CONTRACT_OUTSTOCK_PRINT(RedundantTemplateTypeEnum.CONTRACT_OUTSTOCK.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.CONTRACT_OUTSTOCK.getCode(), ProPermissionAliasEnum.CONTRACT_OUTSTOCK_PRINT.getAlias()),
    RETURNED_PURCHASE_OUTSTOCK_EDIT(RedundantTemplateTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode(), ProPermissionAliasEnum.RETURNED_PURCHASE_OUTSTOCK_UPDATE.getAlias()),
    RETURNED_PURCHASE_OUTSTOCK_DEL(RedundantTemplateTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode(), ProPermissionAliasEnum.RETURNED_PURCHASE_OUTSTOCK_DELETE.getAlias()),
    RETURNED_PURCHASE_OUTSTOCK_PRINT(RedundantTemplateTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode(), ProPermissionAliasEnum.RETURNED_PURCHASE_OUTSTOCK_PRINT.getAlias()),
    OTHER_OUTSTOCK_EDIT(RedundantTemplateTypeEnum.OTHER_OUTSTOCK.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.OTHER_OUTSTOCK.getCode(), ProPermissionAliasEnum.OUTSTOCK_UPDATE.getAlias()),
    OTHER_OUTSTOCK_DEL(RedundantTemplateTypeEnum.OTHER_OUTSTOCK.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.OTHER_OUTSTOCK.getCode(), ProPermissionAliasEnum.OUTSTOCK_DELETE.getAlias()),
    OTHER_OUTSTOCK_PRINT(RedundantTemplateTypeEnum.OTHER_OUTSTOCK.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.OTHER_OUTSTOCK.getCode(), ProPermissionAliasEnum.OUTSTOCK_PRINT.getAlias()),
    PRODUCTION_MATERIEL_OUTSTOCK_EDIT(RedundantTemplateTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), ProPermissionAliasEnum.PRODUCTION_MATERIEL_OUTSTOCK_UPDATE.getAlias()),
    PRODUCTION_MATERIEL_OUTSTOCK_DEL(RedundantTemplateTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), ProPermissionAliasEnum.PRODUCTION_MATERIEL_OUTSTOCK_DELETE.getAlias()),
    PRODUCTION_MATERIEL_OUTSTOCK_PRINT(RedundantTemplateTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), ProPermissionAliasEnum.PRODUCTION_MATERIEL_OUTSTOCK_PRINT.getAlias()),
    WORK_ORDER_OUTSTOCK_EDIT(RedundantTemplateTypeEnum.WORK_ORDER_OUTSTOCK.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.WORK_ORDER_OUTSTOCK.getCode(), ProPermissionAliasEnum.WORK_ORDER_OUTSTOCK_UPDATE.getAlias()),
    WORK_ORDER_OUTSTOCK_DEL(RedundantTemplateTypeEnum.WORK_ORDER_OUTSTOCK.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.WORK_ORDER_OUTSTOCK.getCode(), ProPermissionAliasEnum.WORK_ORDER_OUTSTOCK_DELETE.getAlias()),
    WORK_ORDER_OUTSTOCK_PRINT(RedundantTemplateTypeEnum.WORK_ORDER_OUTSTOCK.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.WORK_ORDER_OUTSTOCK.getCode(), ProPermissionAliasEnum.WORK_ORDER_OUTSTOCK_PRINT.getAlias()),

    // 盘点单
    INVENTORY_EDIT(RedundantTemplateTypeEnum.INVENTORY.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.INVENTORY.getCode(), ProPermissionAliasEnum.INVENTORY_UPDATE.getAlias()),
    INVENTORY_DEL(RedundantTemplateTypeEnum.INVENTORY.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.INVENTORY.getCode(), ProPermissionAliasEnum.INVENTORY_DELETE.getAlias()),
    INVENTORY_PRINT(RedundantTemplateTypeEnum.INVENTORY.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.INVENTORY.getCode(), ProPermissionAliasEnum.INVENTORY_PRINT.getAlias()),

    // 调拨单
    TRANSFER_COPY(RedundantTemplateTypeEnum.TRANSFER.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.TRANSFER.getCode(), ProPermissionAliasEnum.TRANSFER_ADD.getAlias()),
    TRANSFER_EDIT(RedundantTemplateTypeEnum.TRANSFER.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.TRANSFER.getCode(), ProPermissionAliasEnum.TRANSFER_UPDATE.getAlias()),
    TRANSFER_DEL(RedundantTemplateTypeEnum.TRANSFER.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.TRANSFER.getCode(), ProPermissionAliasEnum.TRANSFER_DELETE.getAlias()),
    TRANSFER_PRINT(RedundantTemplateTypeEnum.TRANSFER.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.TRANSFER.getCode(), ProPermissionAliasEnum.TRANSFER_PRINT.getAlias()),

    // 装配单
    ASSEMBLE_COPY(RedundantTemplateTypeEnum.ASSEMBLE.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.ASSEMBLE.getCode(), ProPermissionAliasEnum.ASSEMBLE_ADD.getAlias()),
    ASSEMBLE_EDIT(RedundantTemplateTypeEnum.ASSEMBLE.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.ASSEMBLE.getCode(), ProPermissionAliasEnum.ASSEMBLE_UPDATE.getAlias()),
    ASSEMBLE_DEL(RedundantTemplateTypeEnum.ASSEMBLE.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.ASSEMBLE.getCode(), ProPermissionAliasEnum.ASSEMBLE_DELETE.getAlias()),
    ASSEMBLE_PRINT(RedundantTemplateTypeEnum.ASSEMBLE.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.ASSEMBLE.getCode(), ProPermissionAliasEnum.ASSEMBLE_PRINT.getAlias()),

    // BOM单
    BOMBILL_COPY(RedundantTemplateTypeEnum.BOMBILL.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.BOMBILL.getCode(), ProPermissionAliasEnum.BOM_BILL_ADD.getAlias()),
    BOMBILL_EDIT(RedundantTemplateTypeEnum.BOMBILL.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.BOMBILL.getCode(), ProPermissionAliasEnum.BOM_BILL_UPDATE.getAlias()),
    BOMBILL_DEL(RedundantTemplateTypeEnum.BOMBILL.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.BOMBILL.getCode(), ProPermissionAliasEnum.BOM_BILL_DELETE.getAlias()),
    BOMBILL_PRINT(RedundantTemplateTypeEnum.BOMBILL.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.BOMBILL.getCode(), ProPermissionAliasEnum.BOM_BILL_PRINT.getAlias()),

    // 生产单
    PRODUCTION_ORDER_COPY(RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), ProPermissionAliasEnum.PRODUCTION_ORDER_ADD.getAlias()),
    PRODUCTION_ORDER_FINISH(RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), SaasButtonEnum.FINISH, RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), ProPermissionAliasEnum.PRODUCTION_ORDER_UPDATE.getAlias()),
    PRODUCTION_ORDER_CLOSE(RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), SaasButtonEnum.CLOSE, RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), ProPermissionAliasEnum.PRODUCTION_ORDER_UPDATE.getAlias()),
    PRODUCTION_ORDER_RESTART(RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), SaasButtonEnum.RESTART, RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), ProPermissionAliasEnum.PRODUCTION_ORDER_UPDATE.getAlias()),
    PRODUCTION_ORDER_EDIT(RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), ProPermissionAliasEnum.PRODUCTION_ORDER_UPDATE.getAlias()),
    PRODUCTION_ORDER_DEL(RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), ProPermissionAliasEnum.PRODUCTION_ORDER_DELETE.getAlias()),
    PRODUCTION_ORDER_PRINT(RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.PRODUCTIONORDER.getCode(), ProPermissionAliasEnum.PRODUCTION_ORDER_PRINT.getAlias()),

    // 仓库
    WAREHOUSE_COPY(RedundantTemplateTypeEnum.WAREHOUSE.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.WAREHOUSE.getCode(), ProPermissionAliasEnum.WAREHOUSE_ADD.getAlias()),
    WAREHOUSE_EDIT(RedundantTemplateTypeEnum.WAREHOUSE.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.WAREHOUSE.getCode(), ProPermissionAliasEnum.WAREHOUSE_UPDATE.getAlias()),
    WAREHOUSE_DEL(RedundantTemplateTypeEnum.WAREHOUSE.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.WAREHOUSE.getCode(), ProPermissionAliasEnum.WAREHOUSE_DELETE.getAlias()),

    // 供应商
    SUPPLIER_COPY(RedundantTemplateTypeEnum.SUPPLIER.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.SUPPLIER.getCode(), ProPermissionAliasEnum.SUPPLIER_ADD.getAlias()),
    SUPPLIER_FINISH(RedundantTemplateTypeEnum.SUPPLIER.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.SUPPLIER.getCode(), ProPermissionAliasEnum.SUPPLIER_UPDATE.getAlias()),
    SUPPLIER_CLOSE(RedundantTemplateTypeEnum.SUPPLIER.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.SUPPLIER.getCode(), ProPermissionAliasEnum.SUPPLIER_DELETE.getAlias()),

    // 供应商联系人
    SUPPLIER_CONTACT_COPY(RedundantTemplateTypeEnum.SUPPLIER_CONTACT.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.SUPPLIER_CONTACT.getCode(), ProPermissionAliasEnum.SUPPLIER_CONTACT_ADD.getAlias()),
    SUPPLIER_CONTACT_EDIT(RedundantTemplateTypeEnum.SUPPLIER_CONTACT.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.SUPPLIER_CONTACT.getCode(), ProPermissionAliasEnum.SUPPLIER_CONTACT_UPDATE.getAlias()),
    SUPPLIER_CONTACT_DEL(RedundantTemplateTypeEnum.SUPPLIER_CONTACT.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.SUPPLIER_CONTACT.getCode(), ProPermissionAliasEnum.SUPPLIER_CONTACT_DELETE.getAlias()),

    // 供应商跟进记录
    SUPPLIER_COMMUNICATE_COPY(RedundantTemplateTypeEnum.JXC_COMMUNICATE.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.JXC_COMMUNICATE.getCode(), ProPermissionAliasEnum.SUPPLIER_COMMUNICATE_ADD.getAlias()),

    // 采购合同
    PURCHASE_COPY(RedundantTemplateTypeEnum.PURCHASE.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.PURCHASE.getCode(), ProPermissionAliasEnum.PURCHASE_ADD.getAlias()),
    PURCHASE_FINISH(RedundantTemplateTypeEnum.PURCHASE.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.PURCHASE.getCode(), ProPermissionAliasEnum.PURCHASE_UPDATE.getAlias()),
    PURCHASE_CLOSE(RedundantTemplateTypeEnum.PURCHASE.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.PURCHASE.getCode(), ProPermissionAliasEnum.PURCHASE_DELETE.getAlias()),
    PURCHASE_PRINT(RedundantTemplateTypeEnum.PURCHASE.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.PURCHASE.getCode(), ProPermissionAliasEnum.PURCHASE_PRINT.getAlias()),
    PURCHASE_COMPARE(RedundantTemplateTypeEnum.PURCHASE.getCode(), SaasButtonEnum.CONTRACT_COMPARE, RedundantTemplateTypeEnum.PURCHASE.getCode(), ProPermissionAliasEnum.CONTRACT_COMPARE_RESULT_ADD.getAlias()),


    // 退货退款
    REFUND_COPY(RedundantTemplateTypeEnum.REFUND.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.REFUND.getCode(), ProPermissionAliasEnum.REFUND_ADD.getAlias()),
    REFUND_FINISH(RedundantTemplateTypeEnum.REFUND.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.REFUND.getCode(), ProPermissionAliasEnum.REFUND_EDIT.getAlias()),
    REFUND_CLOSE(RedundantTemplateTypeEnum.REFUND.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.REFUND.getCode(), ProPermissionAliasEnum.REFUND_DEL.getAlias()),
    PRINT(RedundantTemplateTypeEnum.REFUND.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.REFUND.getCode(), ProPermissionAliasEnum.REFUND_PRINT.getAlias()),

    // 采购退货合同
    RETURNED_PURCHASE_FINISH(RedundantTemplateTypeEnum.RETURNED_PURCHASE.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.RETURNED_PURCHASE.getCode(), ProPermissionAliasEnum.RETURN_PURCHASE_UPDATE.getAlias()),
    RETURNED_PURCHASE_CLOSE(RedundantTemplateTypeEnum.RETURNED_PURCHASE.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.RETURNED_PURCHASE.getCode(), ProPermissionAliasEnum.RETURN_PURCHASE_DELETE.getAlias()),
    RETURNED_PURCHASE_PRINT(RedundantTemplateTypeEnum.RETURNED_PURCHASE.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.RETURNED_PURCHASE.getCode(), ProPermissionAliasEnum.RETURN_PURCHASE_PRINT.getAlias()),

    //工单详情页
    WORK_ORDER_CENETR_DETAIL_COPY(RedundantTemplateTypeEnum.WORKORDER.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.WORKORDER.getCode(), ProPermissionAliasEnum.WORK_ORDER_ADD.getAlias()),
    WORK_ORDER_CENETR_DETAIL_EDIT(RedundantTemplateTypeEnum.WORKORDER.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.WORKORDER.getCode(), ProPermissionAliasEnum.WORK_ORDER_UPDATE.getAlias()),
    WORK_ORDER_CENETR_DETAIL_DEL(RedundantTemplateTypeEnum.WORKORDER.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.WORKORDER.getCode(), ProPermissionAliasEnum.WORK_ORDER_DELETE.getAlias()),
    WORK_ORDER_CENETR_DETAIL_PRINT(RedundantTemplateTypeEnum.WORKORDER.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.WORKORDER.getCode(), ProPermissionAliasEnum.WORK_ORDER_PRINT.getAlias()),

    //报价单详情页
    QUOTATION_COPY(RedundantTemplateTypeEnum.QUOTATION.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.QUOTATION.getCode(), ProPermissionAliasEnum.QUOTATION_ADD.getAlias()),
    QUOTATION_EDIT(RedundantTemplateTypeEnum.QUOTATION.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.QUOTATION.getCode(), ProPermissionAliasEnum.QUOTATION_UPDATE.getAlias()),
    QUOTATION_NEW_VERSION(RedundantTemplateTypeEnum.QUOTATION.getCode(), SaasButtonEnum.NEW_VERSION, RedundantTemplateTypeEnum.QUOTATION.getCode(), ProPermissionAliasEnum.QUOTATION_NEW_VERSION.getAlias()),
    QUOTATION_DEL(RedundantTemplateTypeEnum.QUOTATION.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.QUOTATION.getCode(), ProPermissionAliasEnum.QUOTATION_DELETE.getAlias()),
    QUOTATION_PRINT(RedundantTemplateTypeEnum.QUOTATION.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.QUOTATION.getCode(), ProPermissionAliasEnum.QUOTATION_PRINT.getAlias()),
    //预收款余额
    PREPAYMENT_BALANCE_UPDATE(XbbRefTypeEnum.PREPAYMENT_BALANCE.getCode(), SaasButtonEnum.WRITE_OFF, XbbRefTypeEnum.WRITE_OFF_PREPAYMENT.getCode(), ProPermissionAliasEnum.PAYMENT_SHEET_ADD.getAlias()),
    //红冲的权限在回款单
    PREPAYMENT_BALANCE_RED(XbbRefTypeEnum.PREPAYMENT_BALANCE.getCode(), SaasButtonEnum.RED, XbbRefTypeEnum.RED_PREPAYMENT.getCode(), ProPermissionAliasEnum.PAYMENT_SHEET_RED.getAlias()),
    //预收款余额删除
    PREPAYMENT_BALANCE_DEL(XbbRefTypeEnum.PREPAYMENT_BALANCE.getCode(), SaasButtonEnum.DEL, XbbRefTypeEnum.PREPAYMENT_BALANCE.getCode(), ProPermissionAliasEnum.PAYMENT_SHEET_DELETE.getAlias()),


    //回款单详情
    PAYMENT_SHEET_RED(RedundantTemplateTypeEnum.PAYMENT_SHEET.getCode(), SaasButtonEnum.RED, XbbRefTypeEnum.RED_PAYMENT_SHEET.getCode(), ProPermissionAliasEnum.PAYMENT_SHEET_RED.getAlias()),
    PAYMENT_SHEET_RED_BALANCE(RedundantTemplateTypeEnum.PAYMENT_SHEET.getCode(), SaasButtonEnum.RED_BALANCE, XbbRefTypeEnum.RED_WRITE_OFF_BALANCE.getCode(), ProPermissionAliasEnum.PAYMENT_SHEET_RED.getAlias()),
    PAYMENT_SHEET_EDIT(RedundantTemplateTypeEnum.PAYMENT_SHEET.getCode(), SaasButtonEnum.EDIT, XbbRefTypeEnum.PAYMENT_SHEET.getCode(), ProPermissionAliasEnum.PAYMENT_SHEET_UPDATE.getAlias()),
    PAYMENT_SHEET_DEL(RedundantTemplateTypeEnum.PAYMENT_SHEET.getCode(), SaasButtonEnum.DEL, XbbRefTypeEnum.PAYMENT_SHEET.getCode(), ProPermissionAliasEnum.PAYMENT_SHEET_DELETE.getAlias()),
    PAYMENT_SHEET_PRINT(RedundantTemplateTypeEnum.PAYMENT_SHEET.getCode(), SaasButtonEnum.PRINT, XbbRefTypeEnum.PAYMENT_SHEET.getCode(), ProPermissionAliasEnum.PAYMENT_SHEET_PRINT.getAlias()),
    PAYMENT_SHEET_BAD(RedundantTemplateTypeEnum.PAYMENT_SHEET.getCode(), SaasButtonEnum.BAD_DEBT, XbbRefTypeEnum.BAD_DEBT.getCode(), ProPermissionAliasEnum.PAYMENT_SHEET_BAD.getAlias()),

    //付款单详情
    PAY_SHEET_RED(RedundantTemplateTypeEnum.PAY_SHEET.getCode(), SaasButtonEnum.RED, XbbRefTypeEnum.RED_WRITE_OFF_PAY.getCode(), ProPermissionAliasEnum.PAY_SHEET_RED.getAlias()),
    PAY_SHEET_EDIT(RedundantTemplateTypeEnum.PAY_SHEET.getCode(), SaasButtonEnum.EDIT, XbbRefTypeEnum.PAY_SHEET.getCode(), ProPermissionAliasEnum.PAY_SHEET_UPDATE.getAlias()),
    PAY_SHEET_DEL(RedundantTemplateTypeEnum.PAY_SHEET.getCode(), SaasButtonEnum.DEL, XbbRefTypeEnum.PAY_SHEET.getCode(), ProPermissionAliasEnum.PAY_SHEET_DELETE.getAlias()),
    PAY_SHEET_PRINT(RedundantTemplateTypeEnum.PAY_SHEET.getCode(), SaasButtonEnum.PRINT, XbbRefTypeEnum.PAY_SHEET.getCode(), ProPermissionAliasEnum.PAY_SHEET_PRINT.getAlias()),
    PAY_SHEET_BAD(RedundantTemplateTypeEnum.PAY_SHEET.getCode(), SaasButtonEnum.BAD_DEBT, XbbRefTypeEnum.BAD_DEBT.getCode(), ProPermissionAliasEnum.PAY_SHEET_BAD.getAlias()),

    //预付款余额
    PREPAY_BALANCE_UPDATE(XbbRefTypeEnum.PREPAY_BALANCE.getCode(), SaasButtonEnum.WRITE_OFF, XbbRefTypeEnum.WRITE_OFF_PREPAY.getCode(), ProPermissionAliasEnum.PAY_SHEET_ADD.getAlias()),
    //红冲的权限在付款单
    PREPAY_BALANCE_RED(XbbRefTypeEnum.PREPAY_BALANCE.getCode(), SaasButtonEnum.RED, XbbRefTypeEnum.RED_PREPAY.getCode(), ProPermissionAliasEnum.PAY_SHEET_RED.getAlias()),
    //预付款删除
    PREPAY_BALANCE_DEL(XbbRefTypeEnum.PREPAY_BALANCE.getCode(),SaasButtonEnum.DEL,XbbRefTypeEnum.PREPAY_BALANCE.getCode(), ProPermissionAliasEnum.PAY_SHEET_DELETE.getAlias()),

    // 市场活动
    MARKET_ACTIVITY_COPY(RedundantTemplateTypeEnum.MARKET_ACTIVITY.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.MARKET_ACTIVITY.getCode(), ProPermissionAliasEnum.MARKET_ACTIVITY_ADD.getAlias()),
    MARKET_ACTIVITY_EDIT(RedundantTemplateTypeEnum.MARKET_ACTIVITY.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.MARKET_ACTIVITY.getCode(), ProPermissionAliasEnum.MARKET_ACTIVITY_UPDATE.getAlias()),
    MARKET_ACTIVITY_DEL(RedundantTemplateTypeEnum.MARKET_ACTIVITY.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.MARKET_ACTIVITY.getCode(), ProPermissionAliasEnum.MARKET_ACTIVITY_DELETE.getAlias()),

    // 线索
    CLUE_COPY(RedundantTemplateTypeEnum.CLUE.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.CLUE.getCode(), ProPermissionAliasEnum.CLUE_ADD.getAlias()),
    CLUE_EDIT(RedundantTemplateTypeEnum.CLUE.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.CLUE.getCode(), ProPermissionAliasEnum.CLUE_UPDATE.getAlias()),
    CLUE_DEL(RedundantTemplateTypeEnum.CLUE.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.CLUE.getCode(), ProPermissionAliasEnum.CLUE_DELETE.getAlias()),
    CLUE_ARCHIVED(RedundantTemplateTypeEnum.CLUE.getCode(), SaasButtonEnum.ARCHIVED, RedundantTemplateTypeEnum.CLUE.getCode(), ProPermissionAliasEnum.CLUE_ARCHIVE.getAlias()),
    CLUE_CANCEL_ARCHIVED(RedundantTemplateTypeEnum.CLUE.getCode(), SaasButtonEnum.CANCEL_ARCHIVED, RedundantTemplateTypeEnum.CLUE.getCode(), ProPermissionAliasEnum.CLUE_ARCHIVE.getAlias()),
    CLUE_INVALID(RedundantTemplateTypeEnum.CLUE.getCode(), SaasButtonEnum.INVALID, RedundantTemplateTypeEnum.CLUE.getCode(), ProPermissionAliasEnum.CLUE_UPDATE.getAlias()),
    CLUE_FOLLOW(RedundantTemplateTypeEnum.CLUE.getCode(), SaasButtonEnum.FOLLOW, RedundantTemplateTypeEnum.CLUE.getCode(), ProPermissionAliasEnum.CLUE_UPDATE.getAlias()),
    //CLUE_RECYCLE(RedundantTemplateTypeEnum.CLUE.getCode(),SaasButtonEnum.DATA_TRASH, RedundantTemplateTypeEnum.CLUE.getCode(),ProPermissionAliasEnum.CLUE_RECYCLE.getAlias()),

    //回款计划
    PAYMENT_TASK_COMPLETE(XbbRefTypeEnum.PAYMENT_TASK.getCode(),SaasButtonEnum.COMPLETE,XbbRefTypeEnum.PAYMENT_SHEET.getCode(), ProPermissionAliasEnum.PAYMENT_TASK_UPDATE.getAlias()),
    PAYMENT_TASK_EDIT(XbbRefTypeEnum.PAYMENT_TASK.getCode(),SaasButtonEnum.EDIT,XbbRefTypeEnum.PAYMENT_TASK.getCode(), ProPermissionAliasEnum.PAYMENT_TASK_UPDATE.getAlias()),
    PAYMENT_TASK_DEL(XbbRefTypeEnum.PAYMENT_TASK.getCode(),SaasButtonEnum.DEL,XbbRefTypeEnum.PAYMENT_TASK.getCode(), ProPermissionAliasEnum.PAYMENT_TASK_DELETE.getAlias()),

    //对账单
    REMIND_CONFIRM_STATEMENT(XbbRefTypeEnum.CUSTOMER_STATEMENT_STATISTIC.getCode(), SaasButtonEnum.REMIND_CONFIRM,XbbRefTypeEnum.CUSTOMER_STATEMENT_STATISTIC.getCode(),ProPermissionAliasEnum.REMIND_CONFIRM_STATEMENT.getAlias()),
    VALET_CONFIRM_STATEMENT(XbbRefTypeEnum.CUSTOMER_STATEMENT_STATISTIC.getCode(), SaasButtonEnum.VALET_CONFIRM,XbbRefTypeEnum.CUSTOMER_STATEMENT_STATISTIC.getCode(),ProPermissionAliasEnum.VALET_CONFIRM_STATEMENT.getAlias()),
    REGENERATE_STATEMENT(XbbRefTypeEnum.CUSTOMER_STATEMENT_STATISTIC.getCode(), SaasButtonEnum.REGENERATE,XbbRefTypeEnum.CUSTOMER_STATEMENT_STATISTIC.getCode(),ProPermissionAliasEnum.REGENERATE_STATEMENT.getAlias()),
    ARCHIVE_STATEMENT(XbbRefTypeEnum.CUSTOMER_STATEMENT_STATISTIC.getCode(), SaasButtonEnum.ARCHIVED,XbbRefTypeEnum.CUSTOMER_STATEMENT_STATISTIC.getCode(),ProPermissionAliasEnum.ARCHIVE_STATEMENT.getAlias()),
    CANCEL_ARCHIVED_STATEMENT(RedundantTemplateTypeEnum.CUSTOMER_STATEMENT_STATISTIC.getCode(), SaasButtonEnum.CANCEL_ARCHIVED, RedundantTemplateTypeEnum.CUSTOMER_STATEMENT_STATISTIC.getCode(), ProPermissionAliasEnum.ARCHIVE_STATEMENT.getAlias()),
    CUSTOMER_STATEMENT_PRINT(XbbRefTypeEnum.CUSTOMER_STATEMENT_STATISTIC.getCode(), SaasButtonEnum.PRINT,XbbRefTypeEnum.CUSTOMER_STATEMENT_STATISTIC.getCode(),ProPermissionAliasEnum.CUSTOMER_STATEMENT_PRINT.getAlias()),

    // 信用管理
    CREDIT_TEMPORARY_LIMIT_REVOKE(RedundantTemplateTypeEnum.CREDIT_TEMPORARY_LIMIT.getCode(), SaasButtonEnum.REVOKE, RedundantTemplateTypeEnum.CREDIT_TEMPORARY_LIMIT.getCode(), ProPermissionAliasEnum.CREDIT_TEMPORARY_LIMIT_REVOKE.getAlias()),

    //
    FULL_DISCOUNT_COUPON_COPY(XbbRefTypeEnum.FULL_DISCOUNT_COUPON.getCode(), SaasButtonEnum.MARKET_COPY,XbbRefTypeEnum.FULL_DISCOUNT_COUPON.getCode(), ProPermissionAliasEnum.MARKETING_ACTIVITY_ADD.getAlias()),
    FULL_DISCOUNT_COUPON_EDIT(XbbRefTypeEnum.FULL_DISCOUNT_COUPON.getCode(),SaasButtonEnum.MARKET_EDIT,XbbRefTypeEnum.FULL_DISCOUNT_COUPON.getCode(), ProPermissionAliasEnum.MARKETING_ACTIVITY_EDIT.getAlias()),
    FULL_DISCOUNT_COUPON_DEL(XbbRefTypeEnum.FULL_DISCOUNT_COUPON.getCode(),SaasButtonEnum.MARKET_DEL,XbbRefTypeEnum.FULL_DISCOUNT_COUPON.getCode(), ProPermissionAliasEnum.MARKETING_ACTIVITY_DELETE.getAlias()),

    SPECIAL_GOODS_COPY(XbbRefTypeEnum.SPECIAL_GOODS.getCode(), SaasButtonEnum.MARKET_COPY,XbbRefTypeEnum.SPECIAL_GOODS.getCode(), ProPermissionAliasEnum.PROMOTION_ACTIVITY_ADD.getAlias()),
    SPECIAL_GOODS_EDIT(XbbRefTypeEnum.SPECIAL_GOODS.getCode(),SaasButtonEnum.MARKET_EDIT,XbbRefTypeEnum.SPECIAL_GOODS.getCode(), ProPermissionAliasEnum.PROMOTION_ACTIVITY_EDIT.getAlias()),
    SPECIAL_GOODS_DEL(XbbRefTypeEnum.SPECIAL_GOODS.getCode(),SaasButtonEnum.MARKET_DEL,XbbRefTypeEnum.SPECIAL_GOODS.getCode(), ProPermissionAliasEnum.PROMOTION_ACTIVITY_DELETE.getAlias()),


    DISTRIBUTOR_COPY(XbbRefTypeEnum.DISTRIBUTOR_MANAGEMENT.getCode(), SaasButtonEnum.COPY, XbbRefTypeEnum.DISTRIBUTOR_MANAGEMENT.getCode(), ProPermissionAliasEnum.DISTRIBUTOR_ADD.getAlias()),
    DISTRIBUTOR_EDIT(XbbRefTypeEnum.DISTRIBUTOR_MANAGEMENT.getCode(), SaasButtonEnum.EDIT, XbbRefTypeEnum.DISTRIBUTOR_MANAGEMENT.getCode(), ProPermissionAliasEnum.DISTRIBUTOR_EDIT.getAlias()),
    DISTRIBUTOR_DEL(XbbRefTypeEnum.DISTRIBUTOR_MANAGEMENT.getCode(), SaasButtonEnum.DEL, XbbRefTypeEnum.DISTRIBUTOR_MANAGEMENT.getCode(), ProPermissionAliasEnum.DISTRIBUTOR_DELETE.getAlias()),

    DISTRIBUTOR_CONTACT_COPY(XbbRefTypeEnum.DISTRIBUTOR_CONTACT.getCode(), SaasButtonEnum.COPY, XbbRefTypeEnum.DISTRIBUTOR_CONTACT.getCode(), ProPermissionAliasEnum.DISTRIBUTOR_CONTACT_ADD.getAlias()),
    DISTRIBUTOR_CONTACT_EDIT(XbbRefTypeEnum.DISTRIBUTOR_CONTACT.getCode(), SaasButtonEnum.EDIT, XbbRefTypeEnum.DISTRIBUTOR_CONTACT.getCode(), ProPermissionAliasEnum.DISTRIBUTOR_CONTACT_EDIT.getAlias()),
    DISTRIBUTOR_CONTACT_DEL(XbbRefTypeEnum.DISTRIBUTOR_CONTACT.getCode(), SaasButtonEnum.DEL, XbbRefTypeEnum.DISTRIBUTOR_CONTACT.getCode(), ProPermissionAliasEnum.DISTRIBUTOR_CONTACT_DELETE.getAlias()),

    DISTRIBUTOR_ACCOUNT_EDIT(XbbRefTypeEnum.DISTRIBUTOR_ACCOUNT.getCode(), SaasButtonEnum.EDIT, XbbRefTypeEnum.DISTRIBUTOR_ACCOUNT.getCode(), ProPermissionAliasEnum.DISTRIBUTOR_ACCOUNT_EDIT.getAlias()),

    //订货单
    ORDER_THROUGH(XbbRefTypeEnum.ORDER.getCode(),SaasButtonEnum.ORDER_THROUGH,XbbRefTypeEnum.ORDER.getCode(),ProPermissionAliasEnum.ORDER_THROUGH.getAlias()),
    ORDER_CANCELLATION(XbbRefTypeEnum.ORDER.getCode(),SaasButtonEnum.ORDER_CANCELLATION,XbbRefTypeEnum.ORDER.getCode(),ProPermissionAliasEnum.ORDER_CANCELLATION.getAlias()),
    ORDER_COPY(XbbRefTypeEnum.ORDER.getCode(),SaasButtonEnum.COPY,XbbRefTypeEnum.ORDER.getCode(),ProPermissionAliasEnum.ORDER_ADD.getAlias()),
    ORDER_EDIT(XbbRefTypeEnum.ORDER.getCode(),SaasButtonEnum.EDIT,XbbRefTypeEnum.ORDER.getCode(),ProPermissionAliasEnum.ORDER_EDIT.getAlias()),
    ORDER_ARCHIVED(RedundantTemplateTypeEnum.ORDER.getCode(), SaasButtonEnum.ARCHIVED, RedundantTemplateTypeEnum.ORDER.getCode(), ProPermissionAliasEnum.ORDER_EDIT.getAlias()),
    ORDER_CANCEL_ARCHIVED(RedundantTemplateTypeEnum.ORDER.getCode(), SaasButtonEnum.CANCEL_ARCHIVED, RedundantTemplateTypeEnum.ORDER.getCode(), ProPermissionAliasEnum.ORDER_EDIT.getAlias()),
    ORDER_DEL(XbbRefTypeEnum.ORDER.getCode(),SaasButtonEnum.DEL,XbbRefTypeEnum.ORDER.getCode(),ProPermissionAliasEnum.ORDER_DELETE.getAlias()),
    ORDER_PRINT(RedundantTemplateTypeEnum.ORDER.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.ORDER.getCode(), ProPermissionAliasEnum.CONTRACT_PRINT.getAlias()),
    //退货单
//    RETURN_COPY(XbbRefTypeEnum.RETURN.getCode(),SaasButtonEnum.COPY,XbbRefTypeEnum.ORDER.getCode(),ProPermissionAliasEnum.RETURN_ADD.getAlias()),
    RETURN_EDIT(XbbRefTypeEnum.RETURN.getCode(),SaasButtonEnum.EDIT,XbbRefTypeEnum.ORDER.getCode(),ProPermissionAliasEnum.RETURN_EDIT.getAlias()),
    RETURN_DEL(XbbRefTypeEnum.RETURN.getCode(),SaasButtonEnum.DEL,XbbRefTypeEnum.ORDER.getCode(),ProPermissionAliasEnum.RETURN_DELETE.getAlias()),
    RETURN_PRINT(RedundantTemplateTypeEnum.RETURN.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.RETURN.getCode(), ProPermissionAliasEnum.REFUND.getAlias()),

    // 出库发货单
    ORDER_OUTSTOCK_EDIT(RedundantTemplateTypeEnum.ORDER_OUTSTOCK.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.ORDER_OUTSTOCK.getCode(), ProPermissionAliasEnum.CONTRACT_OUTSTOCK_UPDATE.getAlias()),
    ORDER_OUTSTOCK_DEL(RedundantTemplateTypeEnum.ORDER_OUTSTOCK.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.ORDER_OUTSTOCK.getCode(), ProPermissionAliasEnum.CONTRACT_OUTSTOCK_DELETE.getAlias()),
    ORDER_OUTSTOCK_PRINT(RedundantTemplateTypeEnum.ORDER_OUTSTOCK.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.ORDER_OUTSTOCK.getCode(), ProPermissionAliasEnum.CONTRACT_OUTSTOCK_PRINT.getAlias()),
    ELECTRONIC_ORDER_PRINT(RedundantTemplateTypeEnum.ORDER_OUTSTOCK.getCode(), SaasButtonEnum.ELECTRONIC_ORDER_PRINT,RedundantTemplateTypeEnum.ORDER_OUTSTOCK.getCode(), ProPermissionAliasEnum.CONTRACT_OUTSTOCK_PRINT.getAlias()),
    ELECTRONIC_ORDER_REPEAT_PRINT(RedundantTemplateTypeEnum.ORDER_OUTSTOCK.getCode(), SaasButtonEnum.ELECTRONIC_ORDER_REPEAT_PRINT,RedundantTemplateTypeEnum.ORDER_OUTSTOCK.getCode(), ProPermissionAliasEnum.CONTRACT_OUTSTOCK_PRINT.getAlias()),

    //调拨单
    FUND_TRANSFER_COPY(RedundantTemplateTypeEnum.FUND_TRANSFER.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.FUND_TRANSFER.getCode(), ProPermissionAliasEnum.FUND_TRANSFER_ADD.getAlias()),
    FUND_TRANSFER_EDIT(RedundantTemplateTypeEnum.FUND_TRANSFER.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.FUND_TRANSFER.getCode(), ProPermissionAliasEnum.FUND_TRANSFER_UPDATE.getAlias()),
    FUND_TRANSFER_PRINT(RedundantTemplateTypeEnum.FUND_TRANSFER.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.FUND_TRANSFER.getCode(), ProPermissionAliasEnum.FUND_TRANSFER_PRINT.getAlias()),
    //其他收入单详情
    OTHER_INCOME_RED(RedundantTemplateTypeEnum.OTHER_INCOME.getCode(), SaasButtonEnum.RED, XbbRefTypeEnum.RED_OTHER_INCOME.getCode(), ProPermissionAliasEnum.OTHER_INCOME_RED.getAlias()),
    OTHER_INCOME_EDIT(RedundantTemplateTypeEnum.OTHER_INCOME.getCode(), SaasButtonEnum.EDIT, XbbRefTypeEnum.OTHER_INCOME.getCode(), ProPermissionAliasEnum.OTHER_INCOME_UPDATE.getAlias()),
    OTHER_INCOME_PRINT(RedundantTemplateTypeEnum.OTHER_INCOME.getCode(), SaasButtonEnum.PRINT, XbbRefTypeEnum.OTHER_INCOME.getCode(), ProPermissionAliasEnum.OTHER_INCOME_PRINT.getAlias()),
    //其他支出单详情
    OTHER_EXPENSE_RED(RedundantTemplateTypeEnum.OTHER_EXPENSE.getCode(), SaasButtonEnum.RED, XbbRefTypeEnum.RED_OTHER_EXPENSE.getCode(), ProPermissionAliasEnum.OTHER_EXPENSE_RED.getAlias()),
    OTHER_EXPENSE_EDIT(RedundantTemplateTypeEnum.OTHER_EXPENSE.getCode(), SaasButtonEnum.EDIT, XbbRefTypeEnum.OTHER_EXPENSE.getCode(), ProPermissionAliasEnum.OTHER_EXPENSE_UPDATE.getAlias()),
    OTHER_EXPENSE_PRINT(RedundantTemplateTypeEnum.OTHER_EXPENSE.getCode(), SaasButtonEnum.PRINT, XbbRefTypeEnum.OTHER_EXPENSE.getCode(), ProPermissionAliasEnum.OTHER_EXPENSE_PRINT.getAlias()),
    // 调整单详情
    COST_ADJUST_EDIT(RedundantTemplateTypeEnum.COST_ADJUST.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.COST_ADJUST.getCode(), ProPermissionAliasEnum.COST_ADJUST_EDIT.getAlias()),
    COST_ADJUST_DEL(RedundantTemplateTypeEnum.COST_ADJUST.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.COST_ADJUST.getCode(), ProPermissionAliasEnum.COST_ADJUST_DELETE.getAlias()),
    COST_ADJUST_PRINT(RedundantTemplateTypeEnum.COST_ADJUST.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.COST_ADJUST.getCode(), ProPermissionAliasEnum.COST_ADJUST_PRINT.getAlias()),
    // 知识条目详情
    KNOWLEDGE_DATA_EDIT(XbbRefTypeEnum.KNOWLEDGE_BASE.getCode(), SaasButtonEnum.KNOWLEDGE_EDIT, XbbRefTypeEnum.KNOWLEDGE_BASE.getCode(), null),
    KNOWLEDGE_DATA_DEL(XbbRefTypeEnum.KNOWLEDGE_BASE.getCode(), SaasButtonEnum.KNOWLEDGE_DELETE, XbbRefTypeEnum.KNOWLEDGE_BASE.getCode(), null),
    KNOWLEDGE_DATA_ENABLE(XbbRefTypeEnum.KNOWLEDGE_BASE.getCode(), SaasButtonEnum.ENABLE, XbbRefTypeEnum.KNOWLEDGE_BASE.getCode(), null),

    //回执单详情
    RECEIPT_ORDER_EDIT(RedundantTemplateTypeEnum.RECEIPT_ORDER.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.RECEIPT_ORDER.getCode(), ProPermissionAliasEnum.SERVICE_PROJECT_UPDATE.getAlias()),
    RECEIPT_ORDER_PRINT(RedundantTemplateTypeEnum.RECEIPT_ORDER.getCode(), SaasButtonEnum.PRINT, RedundantTemplateTypeEnum.RECEIPT_ORDER.getCode(), ProPermissionAliasEnum.RECEIPT_ORDER_PRINT.getAlias()),
    RECEIPT_ORDER_DEL(RedundantTemplateTypeEnum.RECEIPT_ORDER.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.RECEIPT_ORDER.getCode(), ProPermissionAliasEnum.RECEIPT_ORDER_DELETE.getAlias()),
    // 竞争对手详情
    COMPETITOR_COPY(RedundantTemplateTypeEnum.COMPETITOR.getCode(), SaasButtonEnum.COPY, RedundantTemplateTypeEnum.COMPETITOR.getCode(), ProPermissionAliasEnum.COMPETITOR_ADD.getAlias()),
    COMPETITOR_EDIT(RedundantTemplateTypeEnum.COMPETITOR.getCode(), SaasButtonEnum.EDIT, RedundantTemplateTypeEnum.COMPETITOR.getCode(), ProPermissionAliasEnum.COMPETITOR_EDIT.getAlias()),
    COMPETITOR_DEL(RedundantTemplateTypeEnum.COMPETITOR.getCode(), SaasButtonEnum.DEL, RedundantTemplateTypeEnum.COMPETITOR.getCode(), ProPermissionAliasEnum.COMPETITOR_DELETE.getAlias()),
    COMPETITOR_PRINT(RedundantTemplateTypeEnum.COMPETITOR.getCode(), SaasButtonEnum.PRINT,RedundantTemplateTypeEnum.COMPETITOR.getCode(),ProPermissionAliasEnum.COMPETITOR_PRINT.getAlias()),
    ;

    private Integer businessType;
    private SaasButtonEnum anEnum;
    private Integer linkBusinessType;
    private String permission;

    BusinessDetailButtonEnum(Integer businessType, SaasButtonEnum anEnum, Integer linkBusinessType, String permission) {
        this.businessType = businessType;
        this.anEnum = anEnum;
        this.linkBusinessType = linkBusinessType;
        this.permission = permission;
    }

    public static List<BusinessDetailButtonEnum> getByBusinessType(Integer businessType) {
        List<BusinessDetailButtonEnum> list = new ArrayList<>();
        for (BusinessDetailButtonEnum buttonEnum : BusinessDetailButtonEnum.values()) {
            if (Objects.equals(businessType, buttonEnum.getBusinessType())) {
                list.add(buttonEnum);
            }
        }
        return list;
    }

    public static List<BusinessDetailButtonEnum> getByBusinessTypeAndPermission(Integer businessType, Set<String> permissions) {
        List<BusinessDetailButtonEnum> list = new ArrayList<>();
        for (BusinessDetailButtonEnum buttonEnum : BusinessDetailButtonEnum.values()) {
            boolean hasPermission = true;
            if (Objects.nonNull(buttonEnum.getPermission())) {
                hasPermission = permissions.contains(buttonEnum.getPermission());
            }
            if (Objects.equals(businessType, buttonEnum.getBusinessType()) && hasPermission) {
                list.add(buttonEnum);
            } else if (Objects.equals(businessType, buttonEnum.getBusinessType()) && Objects.equals(buttonEnum.getAnEnum().getAttr(), SaasButtonEnum.CONTRACT_COMPARE.getAttr())) {
                list.add(buttonEnum);
            }
        }
        return list;
    }

}
